<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('选择中国工人工日单价')" />
</head>
<body class="gray-bg">
     <input type="hidden" id="rowIds">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								<label>国别：</label>
								<select name="countryType" th:with="type=${@dict.getType('country_list')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li>
								<label>年份：</label>
								<input type="text" class="time-input-year" placeholder="请选择年份" name="year"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
		var prefix = ctx + "system/history";
		var countryTypeDatas = [[${@dict.getType('country_list')}]];
		var currencyTypeDatas = [[${@dict.getType('currency_type')}]];

		$(function() {
			var options = {
				url: prefix + "/list?priceType=1",
				showSearch: false,
				showRefresh: false,
				showToggle: false,
				showColumns: false,
				sortName: "year",
				sortOrder: "desc",
				columns: [{
					field: 'selectItem',
					radio: true
				},
					{
						field: 'id',
						title: '主键',
						visible: false
					},
					{
						field: 'countryType',
						title: '国别',
						formatter: function(value, row, index) {
							return $.table.selectDictLabel(countryTypeDatas, value);
						}
					},
					{
						field: 'year',
						title: '年份'
					},
					{
						field: 'currencyType',
						title: '货币类型',
						formatter: function(value, row, index) {
							return $.table.selectDictLabel(currencyTypeDatas, value);
						}
					},
					{
						field: 'priceVal',
						title: '单价'
					}]
			};
			$.table.init(options);
		});

		/* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
		function getSelections() {
			var price = $.table.selectColumns("priceVal")[0]
			var currencyType = $.table.selectColumns("currencyType")[0]
			return {"price":price,"currencyType":currencyType};
		}

    </script>
</body>
</html>